#ifndef _RDA_BT_CODE_H_
#define _RDA_BT_CODE_H_


/******************************************************************************
 * MODULE NAME:    bt_codec.h
 * PROJECT CODE:    BlueStream
 * DESCRIPTION:    Encode and decode
 * MAINTAINER:     Tianwq
 * DATE:           6 May 2008
 *
 * SOURCE CONTROL: $Id: bt_codec.h,v 1.5 2008/12/31 10:03:09 tianwq Exp $
 *
 * LICENSE:
 *     This source code is copyright (c) 2008 RDA Inc.
 *     All rights reserved.
 *
 *    
 ******************************************************************************/

#define BT_CODE_END         0
#define BT_CODE_BYTE        1
#define BT_CODE_WORD        2
#define BT_CODE_3BYTE       3
#define BT_CODE_DWORD       4
#define BT_CODE_VAR_DATA    5
#define BT_CODE_BDADDR      6

#define BT_CODE_EVENT_STRING      7
// 0 denotes "specified"
// 1 denotes "unspecified"
// 2 denotes "unknown"
typedef struct {
    u_int8 value_8bit[4];
    u_int16 value_16bit[4];
    u_int32 value_32bit[2];
    const u_int8 *p_var_data;
    const u_int8 *p_bd_addr;
} t_encode_param;

u_int8 *EncodeData(u_int8 *buffer, u_int32 format, ...);
u_int8 *EncodeDataParam(u_int8 *buffer, u_int32 format, const t_encode_param *param);
u_int8 *DecodeData(u_int8 *buffer, u_int32 format, ...);

#endif

